package in

import "github.com/gogf/gf/net/ghttp"

//整理数据,存到map,数量可选填
func defDealData(code bool, data interface{}, count ...int64) interface{} {
	l := newResponse(code, data)
	if len(count) > 0 {
		return l.toCount(count[0])
	}
	return l
}

//默认成功方法
func defFuncSucc(r *ghttp.Request, v interface{}, co ...int64) {
	Json200(r, v, co...)
}

//默认失败方法
func defFuncFail(r *ghttp.Request, v interface{}) {
	writeJson(r, 200, dealData(false, v))
}
